package cn.lkp.mall.cart.config;
import cn.lkp.mall.cart.interceptor.CartInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
 * 将拦截器加入web配置
 */
@Configuration
public class MallWebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //拦截所有购物车请求
        registry.addInterceptor(new CartInterceptor()).addPathPatterns("/**");
    }
}
